package net.entelijan.cobean.examples.showcase.bind.combobox;

import net.entelijan.cobean.data.literature.LitBook;
import net.entelijan.cobean.examples.showcase.ShowcaseTestFrame;
import net.entelijan.cobean.examples.util.ExamplesUtil;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ComboBoxRunner {

	private static Log log = LogFactory.getLog(ComboBoxRunner.class);

	public ComboBoxRunner() {
		super();
	}

	public static void main(String[] args) {
		ComboBoxPanel panel = new ComboBoxPanel();
		ShowcaseTestFrame frame = new ShowcaseTestFrame(panel);
		frame.setSize(400, 500);
		frame.setVisible(true);
		ComboBoxShowcase sc = new ComboBoxShowcase();
		sc.setService(ExamplesUtil.createTestService());
		log.debug("---- (1) sc.init(panel); ----");
		sc.init(panel);
		log.debug("---- (2) sc.init(panel); ----");
		ComboBoxShowcaseModel model = sc.getModel();
		LitBook litBook = model.getBooks().get(3);
		log.debug("---- (1) model.setSelectedBook(litBook) ----");
		model.setSelectedBook(litBook);
		log.debug("---- (2) model.setSelectedBook(litBook) ----");

	}

}
